home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
PROGRAMR
/
UPC12BS1.ZIP
/
MAIL
/
RMAIL.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-09-20
|
42KB
|
1,040 lines
/*--------------------------------------------------------------------*/
/* r m a i l . c */
/* */
/* Delivery agent for UUPC/extended */
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
/* Changes Copyright (c) 1989 by Andrew H. Derbyshire. */
/* */
/* Changes Copyright (c) 1990-1993 by Kendra Electronic */
/* Wonderworks. */
/* */
/* All rights reserved except those explicitly granted by the */
/* UUPC/extended license agreement. */
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
/* RCS Information */
/*--------------------------------------------------------------------*/
/*
* $Id: rmail.c 1.13 1993/09/20 04:39:51 ahd Exp $
*
* $Log: rmail.c $
* Revision 1.13 1993/09/20 04:39:51 ahd
* OS/2 2.x support
*
* Revision 1.12 1993/07/31 16:22:16 ahd
* Changes in support of Robert Denny's Windows 3.x support
*
* Revision 1.11 1993/07/24 03:40:55 ahd
* Make usage() return code unique
*
* Revision 1.10 1993/06/13 14:06:00 ahd
* Save invoked program name and use it for recursive calls
*
* Revision 1.9 1993/05/09 03:41:47 ahd
* Don't use debuglevel -1, it suppresses important configuration errors
*
* Revision 1.8 1993/04/15 03:17:21 ahd
* Correct conditions under which name in userp structure used
*
* Revision 1.7 1993/04/13 02:26:30 ahd
* Make return codes more unique
*
* Revision 1.6 1993/04/11 00:33:05 ahd
* Global edits for year, TEXT, etc.
*
* Revision 1.5 1992/12/05 23:38:43 ahd
* Let logger close the log, not rmail
*
* Revision 1.4 1992/12/04 01:00:27 ahd
* Add copyright messages
*
*/
/*--------------------------------------------------------------------*/
/* Function: Stand alone mail delivery module for */
/* UUPC/extended */
/* Language: Borland C++ 3.1 (ANSI C mode) or Microsoft C 6.0. */
/* Arguments: One or more addresses to deliver mail to */
/* or "-t" to direct rmail to read the addresses */
/* from the RFC-822 header. */
/* A third mode of operation is to specify '-w' and/ */
/* or '-s subject' followed by one or more addresses */
/* with optional carbon copy flags (-c or -b) before */
/* additional addresses. This causes rmail to */
/* function like a bare bones batch version of the */
/* MAIL program; a valid RFC-822 header is generated */
/* and the mail is delivered, aliases are not expanded */
/* and the mail is not locally logged. (The current */
/* user id as the from address is used unless the */
/* environment variable LOGNAME is set, in which case */
/* it is used.) */
/* Optional argument "-f" to denote file to read in */
/* place of stdin. */
/* Optional argument "-F" to denote file to read in */
/* place of stdin and DELETE after readering. */
/* Optional argument "-x" to for debug level */
/* Input: mail to be delivered, with RFC-822 header, on */
/* stdin. */
/* Output: 'From' and 'Received:' headers are added, */
/* 'Bcc:' headers are removed, and the mail is */
/* delivered to one or more local users and/or */
/* one or more remote users. */
/* Exit code: 0 Success */
/* 1 One or more letters not delivered */
/* 2 No mail delivered */
/* 3 Configuration file error */
/* 4 Invalid option/help specified */
/* 5 Input/output error */
/* 6 Input/output error */
/* 7 Input/output error */
/* */
/* Note: When parsing RFC-822 headers, this program */
/* expects them to be "well-behaved", that is in */
/* format generated by UUPC/extended. This implies: */
/* */
/* One address per line */
/* */
/* Resent- headers, if any, before the original */
/* headers. */
/* */
/* From: header must precede To: header. */
/* */
/* To: header must precede Cc: and Bcc: headers. */
/* */
/* Cc: and Bcc: headers must be together (one */
/* after the other) */
/* */
/* The MUA has prefixed any obsolete Resent- */
/* headers by X- */
/* */
/* Note: The "-t" flag is supported by BSD sendmail for the */
/* purpose listed above, but we also turn use it to */
/* control other special options, all of which */
/* basically cause the program to act more like a */
/* local mailer than a remote mailer; these options */
/* include: */
/* */
/* Stripping off blind carbon copies */
/* */
/* Generating the UUCP From line differently */
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
/* System include files */
/*--------------------------------------------------------------------*/
#include <stdio.h>
#include <ctype.h>
#include <io.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <signal.h>
#ifdef _Windows
#include <windows.h>
#endif
/*--------------------------------------------------------------------*/
/* Application include files */
/*--------------------------------------------------------------------*/
#include "lib.h"
#include "address.h"
#include "arpadate.h"
#include "deliver.h"
#include "getopt.h"
#include "hlib.h"
#include "hostable.h"
#include "logger.h"
#include "security.h"
#include "usertabl.h"
#include